package com.sc.admin.base.vo.route;

import com.sc.common.entity.RouteEntity;

import java.util.List;

public record RouteListVO(
        Long id,
        Long pid,
        Integer type,
        Integer openType,
        String title,
        String icon,
        String route,
        String powerRoute,
        Integer weigh,
        List<RouteListVO> children
) {
    public static RouteListVO build(RouteEntity routeEntity) {
        return new RouteListVO(
                routeEntity.getId(),
                routeEntity.getPid(),
                routeEntity.getType(),
                routeEntity.getOpenType(),
                routeEntity.getTitle(),
                routeEntity.getIcon(),
                routeEntity.getRoute(),
                routeEntity.getPowerRoute(),
                routeEntity.getWeigh(),
                List.of()
        );
    }
}
